package hos.demo

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import hos.demo.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

    private val mLayout by lazy { ActivityMainBinding.inflate(layoutInflater) }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(mLayout.root)
        mLayout.uploadPollutionCategory.textView.setOnClickListener {
            Toast.makeText(this, "上传", Toast.LENGTH_SHORT).show()
            mLayout.uploadPollutionCategory.setContent("上传")
        }
        mLayout.editLayout.clickable(false)
        mLayout.iconEdit.setOnPrefixIconClickListener {
            // 前缀
            Toast.makeText(this, "前缀", Toast.LENGTH_SHORT).show()
        }
        mLayout.iconEdit.setOnSuffixIconClickListener {
            // 后缀
            Toast.makeText(this, "后缀", Toast.LENGTH_SHORT).show()
        }

        mLayout.iconEditClick.setOnSuffixIconClickListener {
            // 后缀
            Toast.makeText(this, "iconEditClick后缀", Toast.LENGTH_SHORT).show()
        }
        mLayout.iconEditPassword.setOnSuffixIconClickListener {
            // 后缀
            Toast.makeText(this, "iconEditPassword", Toast.LENGTH_SHORT).show()
        }
        mLayout.iconText.setOnPrefixIconClickListener {
            // 前缀
            Toast.makeText(this, "iconText前缀", Toast.LENGTH_SHORT).show()
        }
        mLayout.iconText.setOnSuffixIconClickListener {
            // 后缀
            Toast.makeText(this, "iconText后缀", Toast.LENGTH_SHORT).show()
        }
//        mLayout.textLayout.removeSuffixOut()
    }
}